<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: ycw
 * @Date: 2022-02-16 13:44:39
 * @LastEditors: ycw
 * @LastEditTime: 2022-02-16 14:38:26
-->
<template>
  <div v-loading="loading" :style="'height:' + height">
    <iframe
      :src="src"
      frameborder="no"
      style="width: 100%; height: 100%"
      scrolling="auto"
    />
  </div>
</template>
<script lang="ts">
import { defineComponent, onMounted, reactive, toRefs } from "@vue/runtime-core";

export default defineComponent({
  props: {
    src: {
      type: String,
      required: true
    },
  },

  setup(_){
    const dataMap=reactive({
      height: document.documentElement.clientHeight - 94.5 + "px;",
      loading: true,
      url: _.src,
      
    })
    onMounted(()=>{
       setTimeout(() => {
        dataMap.loading = false;
      }, 300);
      window.onresize = function temp() {
        dataMap.height = document.documentElement.clientHeight - 94.5 + "px;";
      };
    })
   return{
     ...toRefs(dataMap)
   }
  }
})
</script>